import { getBanner_api } from '@/api/homePage'
import { openNotification } from '@/utils/commonUtils'
import { useEffect, useState } from 'react'
export default function useHomePageApi() {
    const [bannerList, setBannerList] = useState([])
    const getBannerList = () => {
        getBanner_api().then((res: any) => {
            setBannerList(res.banners)
        }).catch((rej) => {
            console.log(rej);
            openNotification('error',rej.message)
        })
    }
    useEffect(() => {
        getBannerList()
    },[])
    return {
        bannerList
    }
}
